<template>
  <el-container :class="$style.container">
    <el-aside v-show="true" :class="$style['layer_aside']" width="200px">
      <layout-aside />
    </el-aside>
    <el-main :class="$style['main-container']">
      <!-- <Header v-if="displaySide" :routeName="($route.name)" :route="$route"></Header> -->
      <div :class="$style.content">
        <router-view v-if="pageShow" />
      </div>
    </el-main>
  </el-container>
</template>

<script lang="ts">
import { defineComponent, ref, watch } from "vue";
import { useRoute } from "vue-router";
import LayoutAside from "./components/LayoutAside.vue";
// import Header from './components/Header.vue'

export default defineComponent({
  components: {
    LayoutAside,
    // Header,
  },
  setup(props, { emit }) {
    const route = useRoute();
    const pageShow = ref(true);
    const refreshPage = () => {
      pageShow.value = false;
      setTimeout(() => {
        pageShow.value = true;
      }, 50);
    };
    watch(
      () => route.fullPath,
      (toPath) => {
        refreshPage();
      },
      { immediate: true, deep: true }
    );

    // provide('refreshPage', refreshPage)
    return {
      pageShow,
    };
  },
});
</script>

<style lang="scss" module>
.container {
  height: calc(100vh - 60px);
}

.layer_aside {
  position: relative;
  width: auto !important;
  border-right: solid 1px #e6e6e6;
}

.tags-view-wrapper {
  background: #fff;
  flex: 0 36px;
  height: 34px;
  border-bottom: 1px solid #d8dce5;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04);

  .tags-view-item {
    display: inline-block;
    position: relative;
    height: 26px;
    line-height: 26px;
    border-right: 1px solid #d8dce5;
    color: #495060;
    background: #fff;
    padding: 0 8px;
    font-size: 16px;
    margin-left: 5px;
    margin-top: 4px;

    &:first-of-type {
      margin-left: 15px;
    }

    &.active {
      // background-color: #42b983;
      // color: #999;
      // border-color: #42b983;
      &::before {
        content: "";
        background: #2c7dff;
        display: inline-block;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        position: relative;
        margin-right: 2px;
      }
    }
  }
}

.main-container {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f5f7f9;

  .content {
    margin: 10px;
    flex: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
}
</style>
